package  model.tree
{
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	
	import valueObjects.VOPlace;

	[Bindable]
	public class PlaceNode extends EventDispatcher
	{
		/*********************************
		 *    Attributes
		 ********************************/
		[Embed("data/images/icons/icon1.png")]
		public static var ICON1:Class;
		
		public var icon:Class;
		
		public var label:String;
		public var children:ArrayCollection;
		
		
		// actual attributes
		public var placeData:VOPlace;
		
		public function PlaceNode(place:VOPlace = null)
		{
			if (place == null)
			{
				// create a new VOPlace
				place = new VOPlace();
				place.name = "no name";
				place.place_id = "-1";
				place.user_description = "no description";
				place.state = "0";
				place.lat = "0";
				place.lon = "0";
			}
			
			// initializing the local data
			placeData = place;
			label = place.name;
			icon = ICON1;
		}


	}
}